/*
 *    Copyright (c) 2018-2025, cloud All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: cloud
 */

package com.fuyao.cloud.asset.entity.receive;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fuyao.cloud.asset.util.AssetUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 资产领用清单
 *
 * @author liyue
 * @date 2021-12-16 10:41:17
 */
@Data
@TableName("fy_asset_receive_list")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "资产领用清单")
public class ReceiveList extends Model<ReceiveList> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId
    @ApiModelProperty(value="主键ID")
    private Long id;

    /**
     * 创建人ID
     */
	@TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value="创建人ID")
    private Integer createId;

    /**
     * 创建人姓名
     */
	@TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value="创建人姓名")
    private String createBy;

    /**
     * 创建人所属OU的全称
     */
	@TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value="创建人所属OU的全称")
    private String deptFullname;

    /**
     * 创建人所属OU的ID
     */
	@TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value="创建人所属OU的ID")
    private Integer deptId;

    /**
     * 状态：默认为0{0：草稿、1：处理中、2：已审批、3：已完成、4：作废}状态值根据父单的更新，已完成状态根据单项入库数量等于采购数量并且验收单完成后更新为已完成
     */
    @ApiModelProperty(value="状态：默认为0{0：草稿、1：处理中、2：已审批、3：已完成、4：作废}状态值根据父单的更新，已完成状态根据单项入库数量等于采购数量并且验收单完成后更新为已完成 ")
    private Integer status;

    /**
     * 父订单ID
     */
    @ApiModelProperty(value="父订单ID")
    private Long parentId;

    /**
     * 父订单单号
     */
    @ApiModelProperty(value="父订单单号")
    private String parentCaseid;

    /**
     * 数据删除标记
     */
    @ApiModelProperty(value="数据删除标记")
    private String delFlag;

    /**
     * 租户ID
     */
    @ApiModelProperty(value="租户ID")
    private Integer tenantId;

    /**
     * 创建时间
     */
    @ApiModelProperty(value="创建时间")
    private LocalDateTime createTime;

    /**
     * 资产分类全编码
     */
    @ApiModelProperty(value="资产分类全编码")
    private String classifiedCode;

    /**
     * 资产分类全名称
     */
    @ApiModelProperty(value="资产分类全名称")
    private String classified;

    /**
     * 资产分类名称
     */
    @ApiModelProperty(value="资产分类名称")
    private String ctiName;

    /**
     * 资产分类ID
     */
    @ApiModelProperty(value="资产分类ID")
    private Long ctiId;

    /**
     * 照片
     */
    @ApiModelProperty(value="照片")
    private String photo;

    /**
     * 资产编码
     */
    @ApiModelProperty(value="资产编码")
    private String number;

    /**
     * 名称
     */
    @ApiModelProperty(value="名称")
    private String name;

    /**
     * 规格型号
     */
    @ApiModelProperty(value="规格型号")
    private String model;

    /**
     * 计量单位
     */
    @ApiModelProperty(value="计量单位")
    private String unit;

    /**
     * 总价
     */
    @ApiModelProperty(value="总价")
    private BigDecimal amount;

    @TableField(exist = false)
    private Long amountLong;

    /**
     * 备注
     */
    @ApiModelProperty(value="备注")
    private String remarks;

	@ApiModelProperty(value="产品ID")
	private Long assetCardId;

	public String getStatusCn(){
		return AssetUtils.formatStatus(String.valueOf(this.status));
	}

    public Long getAmountLong(){
    	return this.amount.longValue();
	}

}
